
package com.audi.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "tbl_my_visitor")
public class MyVisitor implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * visitorId       db_column: visitor_id 
     */ 	
	
	private Long visitorId;
    /**
     * userId       db_column: user_id 
     */ 	
	
	private Long userId;
    /**
     * visitUserName       db_column: visit_user_name 
     */ 	
	//@Length(max=64)
	private java.lang.String visitUserName;
    /**
     * visitUserId       db_column: visit_user_id 
     */ 	
	
	private Long visitUserId;
    /**
     * visitTime       db_column: visit_time 
     */ 	
	
	private java.util.Date visitTime;
    /**
     * visitCount       db_column: visit_count 
     */ 	
	
	private Long visitCount;
	//columns END


	public MyVisitor(){
	}

	public MyVisitor(
		Long visitorId
	){
		this.visitorId = visitorId;
	}

	

	public void setVisitorId(Long value) {
		this.visitorId = value;
	}
	
	@Id 
	//@SequenceGenerator(name="visitor_SEQ",sequenceName="seq_visitor")
    // @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="visitor_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "visitor_id", unique = false, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getVisitorId() {
		return this.visitorId;
	}
	
	@Column(name = "user_id", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "visit_user_name", unique = false, nullable = true, insertable = true, updatable = true, length = 64)
	public java.lang.String getVisitUserName() {
		return this.visitUserName;
	}
	
	public void setVisitUserName(java.lang.String value) {
		this.visitUserName = value;
	}
	
	@Column(name = "visit_user_id", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getVisitUserId() {
		return this.visitUserId;
	}
	
	public void setVisitUserId(Long value) {
		this.visitUserId = value;
	}
	
	
	@Column(name = "visit_time", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getVisitTime() {
		return this.visitTime;
	}
	
	public void setVisitTime(java.util.Date value) {
		this.visitTime = value;
	}
	
	@Column(name = "visit_count", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getVisitCount() {
		return this.visitCount;
	}
	
	public void setVisitCount(Long value) {
		this.visitCount = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("VisitorId",getVisitorId())
			.append("UserId",getUserId())
			.append("VisitUserName",getVisitUserName())
			.append("VisitUserId",getVisitUserId())
			.append("VisitTime",getVisitTime())
			.append("VisitCount",getVisitCount())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getVisitorId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof MyVisitor == false) return false;
		if(this == obj) return true;
		MyVisitor other = (MyVisitor)obj;
		return new EqualsBuilder()
			.append(getVisitorId(),other.getVisitorId())
			.isEquals();
	}
}

